home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / DELPHI32 / DATETIME / DRAWC13 / DRAWC13.TXT next >
Text File  |  1996-06-23  |  3KB  |  70 lines

  1. Version 1.3
  2. Releasing source as freeware.  Have changed the code so that the pastetext, pastebitmap and pasteicon functions all get passed a TDateTime instead of a string representation od a date as before.  This was necessary for compatibility with various date formats used by other countries.
  3.  
  4.  
  5.  
  6.  
  7. Version 1.2
  8.  
  9. PasteText now prints text with a transparent background.
  10.  
  11. function IsCurrentMonth(TheDate: TDateTime): Boolean;
  12. is public (always was in previous versions, but didn't mention it in case I removed it from public).
  13. This function gets passed a TDateTime and returns True if the date is of the current DrawCalendar month.  If it is not of the current month it returns false.  The reason I mention this is that it can be used to speed up the calendar drawing.  The way I use it is to filter my database of records by date, only choosing those that return true to IsCurrentMonth.  Then in the OnDrawCell event I use a loop
  14.  
  15. for n := 1 to database.items.count
  16. begin
  17.    PasteBitmap(Database.date, Database.Bitmap);
  18.    PasteText(Database.date, Database.text);
  19. end;
  20.  
  21. This prevents the drawcalendar from having to check for IsCurrentMonth (which it automatically does when you pass a date) on dates that are not current.
  22.  
  23.  
  24. Version 1.1
  25.  
  26. Added properties:
  27.  
  28. UseLongDayNames : Boolean;
  29. ColumnColor0 : TColor;
  30. ColumnColor1 : TColor;
  31. ColumnColor2 : TColor;
  32. ColumnColor3 : TColor;
  33. ColumnColor4 : TColor;
  34. ColumnColor5 : TColor;
  35. ColumnColor6 : TColor;
  36.  
  37.  
  38.  
  39. DISCLAIMER:
  40. TDrawCalendar is supplied as is. The author disclaims all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The author assumes no liability for damages,direct or consequential, which may result from the use of TDrawClendar.
  41.  
  42. Copyright ╕ 1996, Andrew J. Williams    andrew@williaj.u-net.com
  43.  
  44.     
  45. About TDrawCalendar:
  46.     TDrawCalendar is a component based on though not descended from the Calendar in the Samples page of the pallette.  I wanted to unublish a couple of published properties (e.g.Font) which meant I could not descend it directly.      
  47.     TDrawCalendar is my first component so I do not expect it to be perfect.
  48.  
  49.  The purpose of this component is to add flexibility to the calendar component
  50.  to allow:
  51.  1. Drawing bitmaps, Icons and text onto particular dates of the calendar.
  52.  2. Allow font setting for the Days of the week, Date numbers and the added text
  53.     as three separate properties (HeaderFont, DateFont and TextFont resp.).
  54.  
  55.  
  56. Another property is Datebox : Boolean;
  57. This property draws a box around the date numbers but this can be set to true or false depending on your needs.
  58.  
  59. The main point of this component is the methods:
  60.  
  61. function PasteBitmap(TheDate : TDateTime; TheBitmap : TBitmap) : Boolean;
  62. function PasteIcon(TheDate : TDateTime; TheIcon : TIcon) : Boolean;
  63. function PasteText(TheDate : TDateTime; MyText : string) : Boolean;
  64.  
  65.  
  66. Icons allow the use of transparent background which makes the calendar more attractive but I have found that placing icons on the DrawCalendar is slower than placing bitmaps.  
  67.  
  68. NOTE:  The more bitmaps that are placed on the DrawCalndar, the slower it re-draws.  I may also try to speed this up in a later release.  The amount of text has less of a bearing on speed.
  69.  
  70.